package com.apkplug.osgi.serviceImp;

import org.osgi.framework.Bundle;

import android.view.View;
import android.widget.LinearLayout;

import com.apkplug.osgi.service.showView;

public class showViewImp implements showView{
	private LinearLayout layout =null;
	/**
	 * @param root 插件 View保存UI容器 
	 */
	public showViewImp(View root){
		this.layout=(LinearLayout)root;
	}
	@Override
	public void showView(Bundle bundle, View v, int index) {
		//当插件查找到服务并使用时回调
		System.out.println("插件传来一个View");
		layout.addView(v);
	}
	@Override
	public void removeView(Bundle bundle, View v) {
		System.out.println("插件需要删除一个View");
		layout.removeView(v);
	}

}
